package org.springframework.boot;

import org.springframework.core.env.MapPropertySource;
import org.springframework.core.io.DefaultResourceLoader;

import java.util.HashMap;
import java.util.Map;

//输出banner
public class Step7 {

    public static void main(String[] args) {
        ApplicationEnvironment env = new ApplicationEnvironment();
        SpringApplicationBannerPrinter bannerPrinter = new SpringApplicationBannerPrinter(new DefaultResourceLoader(), new SpringBootBanner());

        //还可以自定义banner
        Map<String, Object> map = new HashMap<>();
        map.put("spring.banner.location","banner1.txt");
        env.getPropertySources().addLast(new MapPropertySource("custom", map));

        bannerPrinter.print(env,Step7.class,System.out);
    }
}
